package com.geeke.test.entity;

import java.math.BigDecimal;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.geeke.wf.persistence.WfDataEntity;

/**
 * 报销管理Entity
 * @author
 * @version
 */
public class ExpenseDetail extends WfDataEntity<ExpenseDetail> {

    private static final long serialVersionUID = 1382944834704343046L;

    private Expense expense; // 报销

    private String name; // 名称

    private BigDecimal amount = new BigDecimal("0.00"); // 金额

    // 构造方法
    public ExpenseDetail() {
        super();
    }

    public ExpenseDetail(String id) {
        super(id);
    }

    // 生成get和set方法

    @NotNull(message = "报销不能为空")
    public Expense getExpense() {
        return expense;
    }

    public void setExpense(Expense expense) {
        this.expense = expense;
    }

    @Length(min = 1, max = 128, message = "名称长度必须介于 1 和 128 之间")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @NotNull(message = "金额不能为空")
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    /**
     * 获取实体对应表名
     */
    @Override
    @JsonIgnore
    public String getBusTableName() {
        return "test_expense_detail";
    }

    /**
     * 获取实体对应Id
     */
    @Override
    @JsonIgnore
    public String getBusTableId() {
        return "1382944834704343046";
    }

    /**
     * 获取实体表中是否存在del_flag字段
     */
    @JsonIgnore
    public boolean getBusTableHasDelFlag() {
        return true;
    }
}
